package v2

import (
	rpcv1 "gluenet/internal/agent/api/rpc/v1"
	metav1 "gluenet/pkg/agent/option"
	corev1 "gluenet/pkg/agent/types"
	"gluenet/pkg/agent/v2/rpc"
)

type K8sGetter interface {
}

type GluenetGetter interface {
	GluenetApps(guid string) GluenetAppInterface
}

type GluenetAppInterface interface {
	ListContainers(opt metav1.ListOptions) (*corev1.GluenetApp, error)
}

type gluenetApps struct {
	client rpc.Interface
	guid   string
}

func newGluenetApps(c *CoreClient, guid string) *gluenetApps {
	return &gluenetApps{
		client: c.RPCClient(),
		guid:   guid,
	}
}

func (c *gluenetApps) ListContainers(opt metav1.ListOptions) (result *corev1.GluenetApp, err error) {
	result = &corev1.GluenetApp{}
	err = c.client.Invoke().
		Api(rpcv1.ListContainerInNameSpace).
		Guid(c.guid).
		Do().
		Into(result)
	return
}
